package com.wltjack.controller;

import com.wltjack.common.SpringContextUtils;
import com.wltjack.service.MagicService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/magic/condition")
public class MagicConditionController {

    @GetMapping("/info")
    public String info(){
        try {
            MagicService ms = (MagicService) SpringContextUtils.getApplicationContext().getBean("magicService"); // 从Spring容器中获取magicService bean
            return ms.getInfo();
        }catch (Exception e){
            e.printStackTrace();
        }
        return "null";
    }
}
